import {
	observer
} from 'mobx-react';
import {
	Spin
} from 'antd';

@observer
export default class Form extends React.Component {
	render() {
		const {
			store,
		} = this.props, {
			form,
			loading,
			searchGroupProps={},
			comProps={},
		} = store;

		const style = {
			position: 'absolute',
			top: '50%',
			left: '50%',
			marginLeft: -8,
			marginTop: -8,
		}

		if (loading) {
			return (
				<div style={style}>
					<Spin ecId={`${this && this.props && this.props.ecId || ''}_Spin@i61hzr`} spinning={true}></Spin>
				</div>
			)
		}

		return (
			<div>{form.render(searchGroupProps,comProps)}</div>
		);
	}
}